package com.yhsoft.bill.controller;

import com.yhsoft.bill.service.BillReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@ResponseBody
@Slf4j
@Api(tags = "平台账单导出相关接口")
@RequestMapping("/benefitcard")
public class BillReportController {
    @Autowired
    private BillReportService billReportService;

    //预存款消耗日志导出
    @GetMapping("/LogExport")
    @ApiOperation("预存款消耗日志报表")
    public void YckLog(@RequestParam("distributorId") Integer distributorId, HttpServletResponse response) throws IOException {
        billReportService.exportYckLog(response,distributorId);
    }


    //应收款项报表导出
    @GetMapping("/MxExport")
    @ApiOperation("平台应付款报表")
    public void YszkMx(@RequestParam("distributorId") Integer distributorId,HttpServletResponse response) throws IOException {
        billReportService.exportYszkMx(response,distributorId);
    }

    //对账明细表
    @GetMapping("/DetailExport")
    @ApiOperation("对账明细报表")
    public void  Detail(@RequestParam("distributorId") Integer distributorId,HttpServletResponse response)throws IOException{
        billReportService.exportDetail(response,distributorId);
    }


    //应收账款详情列表
    @GetMapping("/AccountsExport")
    @ApiOperation("应收账款详情报表")
    public void  Accounts(HttpServletResponse response)throws IOException{
        billReportService.ExportAccounts(response);
    }

    //应收账款列表
    @GetMapping("/ReceivableExport")
    @ApiOperation("应收账款报表")
    public void  Receivable(HttpServletResponse response)throws IOException{
        billReportService.ExportReceivable(response);
    }

    @GetMapping("/ConsumptionLogExport")
    @ApiOperation("消耗日志报表")
    public void  ConsumptionLog(HttpServletResponse response)throws IOException{
        billReportService.ExportConsumption(response);
    }
}



